package com.wgy.day10.面向对象;

import java.util.Arrays;

/**
 * Created by pc on 2020/11/5 23:13
 * Description: LearningJava
 */
public class Demo01PrintArray {
    public static void main(String[] args) {
        int[] array = {10, 20, 30, 40, 50, 60};
        //要求打印输出的格式为 [10,20,30,40,50,60]
        //使用面向过程.每一步都要亲力亲为
        System.out.print("[");
        for (int i = 0; i < array.length; i++) {
            if (i == array.length - 1) {
                System.out.println(array[i] + "]");
            } else {
                System.out.print(array[i] + ",");
            }
        }

      //使用面向对象,不用自己来做  找一个已经具有改功能的人来帮我做
        System.out.println(Arrays.toString(array));
    }
}
